﻿////Copyright 2011 - Jonathan Allen

//using System;
//using System.Diagnostics;
//using System.Windows.Data;
//using System.Globalization;

//namespace Granite.Xaml.Converters
//{
//	/// <summary>
//	/// Breaks whenever this value is converted or converted back.
//	/// This may wrap another converter so long as that converter doesn't require a parameter.
//	/// </summary>
//    public class DebugBreakConverter : MarkupValueConverter<DebugBreakConverter>
//	{
//		/// <summary>
//		/// 
//		/// </summary>
//		/// <param name="value"></param>
//		/// <param name="targetType">Passed to wrapped value converter</param>
//		/// <param name="parameter">Wrapped valueConverter</param>
//		/// <param name="culture">Passed to wrapped value converter</param>
//		/// <returns></returns>
//		public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
//		{
//			if (Debugger.IsAttached)
//				Debugger.Break();

//			var valueConverter = parameter as IValueConverter;
//			if (valueConverter != null)
//				return valueConverter.Convert(value, targetType, null, culture);

//			return value;
//		}

//		/// <summary>
//		/// 
//		/// </summary>
//		/// <param name="value"></param>
//		/// <param name="targetType">Passed to wrapped value converter</param>
//		/// <param name="parameter">Wrapped valueConverter</param>
//		/// <param name="culture">Passed to wrapped value converter</param>
//		/// <returns></returns>
//		public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
//		{
//			if (Debugger.IsAttached)
//				Debugger.Break();

//			var valueConverter = parameter as IValueConverter;
//			if (valueConverter != null)
//				return valueConverter.ConvertBack(value, targetType, null, culture);

//			return value;
//		}

//	}
//}
